package com.npjscg.medicalpro.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.npjscg.medicalpro.controller.dto.TemplateDTO;
import com.npjscg.medicalpro.entity.Check;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author raote
 * @since 2022-06-30
 */

public interface CheckMapper extends BaseMapper<Check> {

    @Select("SELECT * FROM t_check RIGHT JOIN (t_report LEFT JOIN t_hospital ON t_report.hcode = t_hospital.hcode) ON t_check.rid = t_report.id and t_report.tid = #{tid}"+" ${ew.customSqlSegment}")
    Page<TemplateDTO> getUncheckedList(@Param("page") Page<TemplateDTO> page, @Param(Constants.WRAPPER) QueryWrapper<TemplateDTO> qw, int tid);

}
